import io.IO;
import io.dictionaryInput;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import Data.DictionaryData;
import analyzer.Analyzer;
import count.Counter;

class Main {
	
	/**
	 * Main function
	 * @param argsl;angjksgnsddnmdgon9999999
	 */
	public static void main(String[] args) {
		dictionaryInput dictionIn= new dictionaryInput();
		dictionIn.dictionaryIn();
		List<String> inputList = new ArrayList<String>();
		IO io = new IO();
		
		
		String article = "";
		try {
			article = io.readInput();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			System.out.println("Read error.");
		}
		
		Matcher m = Pattern.compile("([a-zA-z])+").matcher(article);
		while (m.find()) {
			inputList.add(m.group(0));
			//System.out.println(m.group(0));
		}
		Analyzer analyzer = new Analyzer();
		Counter counter = new Counter();
		
		for(String input: inputList) {
			boolean isVocab = analyzer.analyze(input);
			//io.outputResult(isVocab);
			counter.counter(isVocab);
		}
		
		
		System.out.println("There are " + counter.getValue() + " wrong words in the input file.");
		//boolean isVocab = analyzer.analyze(inputList.get(0),wordList);
		//io.outputResult(isVocab);
	}
}